package com.bootdo.staticmask.common;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * ClassName:ParameterUtil
 * 此类存放一些用于查看服务器状态的参数的实际含义
 *
 * @author hc
 */
public final class ParameterUtil {
    private ParameterUtil() {
    }

    public static final String COMMASEPARATOR = ",";//COMMASEPARATOR,逗号

    public static final String SPACESEPARATOR = " ";//SPACESEPARATOR,空格

    public static final List<String> POISON = new ArrayList<String>();//POISON,文件读完了的标志

    //HARDWAREUSAGE,读取磁盘利用率
    public static final String HARDWAREUSAGE = " df -lh | grep /dev/sdb1 | awk '{print $5}'";

    public static final String CPUUSAGE = "cat /proc/stat";    //CPUUSAGE,CPU利用率

    public static final String PRONUM = "cat /proc/loadavg";//PRONUM,进程数

    public static final String LOAD = "cat /proc/loadavg";//LOAD,负载

    public static final String ORACLESTATUS = "lsnrctl status";//ORACLESTATUS,Oracle数据库状态

    public static final String MYSQLSTATUS = "service mysqld status";//MYSQLSTATUS,MySql数据库状态

    public static final String FTPSTATUS = "service vsftpd status";//FTPSTATUS，FTP服务器状态

    public static final int BUFFERSIZE = 33554432;//BUFFERSIZE buffer的大小32M。1024*1024*32

    public static final String CONTROL = ",";//CONTROL 写入hive的分割控制符

    public static final float PRECISION = 0.5f;//正则匹配精度

    public static final int NOMATCH = -1;//正则匹配的结果 -1 代表位没有匹配上

    public static final int NOVALUE = -2;//正则匹配的结果 -2 代表该列都为空值

    public static final int MATCHLINES = 100;//正则匹配的时候默认取出的行数

    public static final String SOURCE_DATABASE = "DBONE";//DBONE

    public static final String DEST_DATABASE = "DBTWO";//DBTWO

    public static final String ORACLE_USER = "SCOTT"; //oracle user

    public static final String ORACLE_PASSWORD = "tiger";//oracle password

    public static final int DATETYPE = 7;
    public static final String SALT="guowang";

    public static final List<String> PHONECODE = ParameterUtil.create();

    public static List<String> create() {
        List<String> strArray = new ArrayList<>();
        for (int i = 10000; i < 20000; i++) {
            String k = String.valueOf(i);
            strArray.add(k.substring(1));
        }
        //打乱已构造的数据
        Collections.shuffle(strArray);
        return strArray;
    }
}
